import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    sign: '咋见之欢, 不如久处不厌', // 签名
    nickName: 'Julius Wang', // 昵称
    autoNym: '王梓豪', // 实名
    phone: '15836611174', // 手机号码
    weather: {
      city: '上海',
      realtime: {
        aqi: '57',
        direct: '东南风',
        humidity: '60',
        info: '阴',
        power: '1级',
        temperature: '27',
        wid: '02'
      }
    },
    gameList: [[3, 6, 9, 8, 5, 1, 2, 0, 4], [8, 1, 2, 0, 4, 7, 0, 3, 6], [7, 5, 0, 6, 3, 0, 8, 9, 0], [1, 4, 0, 7, 2, 3, 9, 6, 8], [2, 0, 0, 1, 6, 9, 7, 0, 0], [9, 7, 6, 5, 0, 4, 1, 0, 0], [6, 2, 7, 3, 1, 0, 4, 0, 9], [0, 0, 3, 2, 9, 5, 6, 1, 7], [5, 9, 1, 4, 7, 6, 0, 8, 2]],
    gameResult: [[3, 6, 9, 8, 5, 1, 2, 7, 4], [8, 1, 2, 9, 4, 7, 5, 3, 6], [7, 5, 4, 6, 3, 2, 8, 9, 1], [1, 4, 5, 7, 2, 3, 9, 6, 8], [2, 3, 8, 1, 6, 9, 7, 4, 5], [9, 7, 6, 5, 8, 4, 1, 2, 3], [6, 2, 7, 3, 1, 8, 4, 5, 9], [4, 8, 3, 2, 9, 5, 6, 1, 7], [5, 9, 1, 4, 7, 6, 3, 8, 2]]
  },
  mutations: {
    updateSign (state, value) {
      state.sign = value
    },
    updateNickName (state, value) {
      state.nickName = value
    },
    updateAutoNym (state, value) {
      state.autoNym = value
    },
    updatePhone (state, value) {
      state.phone = value
    },
    updateWeather (state, value) {
      // console.log(this.state.weather)
      console.log(value)
      state.weather = value
    },
    updateGameList (state, value) {
      state.gameList = value
    },
    updategameResult (state, value) {
      state.gameResult = value
    }
  },
  actions: {

  },
  modules: {

  }
})
